from .base import Base, engine
from .session import get_db, with_session

from .models.user import User, UserGroup, Group, GroupPermission
from .models.knowledge import KnowledgeBase, File2Knowledge
from .models.conversation import Dialog, Conversation
from .models.clause import ClauseStandard, ClauseFile, ClauseGroups, ClauseCompareHistory
from .models.files import QAFile, DualControlFile, AccidentCaseFile, EmergencyFile
from .models.attachments import Attach2File
from .models.material import FileSourceDict, Material, MaterialTypeDict
from .models.data_collect import Article, CrawlTask, DataSource, GlobalConfig
from .models.attributes import ApplicableObject, KnowledgeType, ApplicableArea, ElementClassification, AccidentType, FileAttributeAssociation


def init_db():
    Base.metadata.create_all(bind=engine)
    return True
